package com.winai.launcher.bean;

import android.os.Parcel;
import android.os.Parcelable;

import static com.winai.launcher.bean.BluetoothItemBean.BluetoothState.UNLINK;

/**
 * 作者：康少
 * 时间：2019/11/19 0019
 * 说明：无线wifiBean
 */
public class WifiItemBean implements Parcelable {

    private String wifiName = "未知Wifi";
    private String wifiPsw = "";
    private String BSSID = "";
    private String linkStatus = LinkState.UNLINK;//连接状态：未连接、已连接、正在连接、已保存
    private String wifiType = "";//wifi类型。capabilities
    private int level = -55;

    public class LinkState {
        public static final String LINKED = "已连接";
        public static final String UNLINK = "未连接";
        public static final String SAVED = "已保存";
        public static final String LINKING = "连接中…";
    }

    /**
     * 说明：未连接 wifi
     */
    public WifiItemBean(String wifiName, String BSSID, String linkStatus, String wifiType, int level) {
        this.BSSID = BSSID;
        this.wifiName = wifiName;
        this.linkStatus = linkStatus;
        this.wifiType = wifiType;
        this.level = level;
    }

    /**
     * 说明：已连接 wifi
     */
    public WifiItemBean(String wifiName, String BSSID, String linkStatus, int level) {
        this.BSSID = BSSID;
        this.wifiName = wifiName;
        this.linkStatus = linkStatus;
        this.level = level;
    }

    public WifiItemBean() {
    }

    public String getBSSID() {
        return BSSID;
    }

    public void setBSSID(String BSSID) {
        this.BSSID = BSSID;
    }

    public String getWifiName() {
        return wifiName;
    }

    public void setWifiName(String wifiName) {
        this.wifiName = wifiName;
    }

    public String getWifiPsw() {
        return wifiPsw;
    }

    public void setWifiPsw(String wifiPsw) {
        this.wifiPsw = wifiPsw;
    }

    public String getLinkStatus() {
        return linkStatus;
    }

    public void setLinkStatus(String linkStatus) {
        this.linkStatus = linkStatus;
    }

    public String getWifiType() {
        return wifiType;
    }

    public void setWifiType(String wifiType) {
        this.wifiType = wifiType;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.wifiName);
        dest.writeString(this.wifiPsw);
        dest.writeString(this.BSSID);
        dest.writeString(this.linkStatus);
        dest.writeString(this.wifiType);
    }

    protected WifiItemBean(Parcel in) {
        this.wifiName = in.readString();
        this.wifiPsw = in.readString();
        this.BSSID = in.readString();
        this.linkStatus = in.readString();
        this.wifiType = in.readString();
    }

    public static final Parcelable.Creator<WifiItemBean> CREATOR = new Parcelable.Creator<WifiItemBean>() {
        @Override
        public WifiItemBean createFromParcel(Parcel source) {
            return new WifiItemBean(source);
        }

        @Override
        public WifiItemBean[] newArray(int size) {
            return new WifiItemBean[size];
        }
    };
}
